<%@ page pageEncoding="UTF-8"%>
<body>
	<div class="easyui-layout" style="width: 100%; height: 450px;"
		fit="true">
		<div data-options="region:'center'">
			<table id="dg" title="系统角色管理" url="system/role/main.action"
				toolbar="#toolbar" pagination="true" fitColumns="true"
				singleSelect="true" class="easyui-datagrid" fit="true" singleSelect="false" rownumbers="true">
				<thead>
					<tr>
						 <th field="ck"  checkbox="true"/>
						 <th field="roleCode" width="50" sortable="true" align=center>角色编码</th>
						 <th field="roleName" width="50" sortable="true" align=center>角色名称</th>
						 <th field="memo" width="200" sortable="true" >备注</th>
					</tr>
				</thead>
			</table>
			<div id="toolbar">
				<a href="javascript:void(0)" class="easyui-linkbutton"
					iconCls="icon-add" plain="true" onclick="impower()">权限管理</a>
			</div>
		</div>
	</div>
	<%@ include file="impower.jsp"%>
	<script type="text/javascript">
		var selectRole;
		function impower(){  
            var row = $('#dg').datagrid('getSelected');  
            if (row){  
            	$('#powerTree').tree({
					url:'system/role/getRolePowerMenuTree.action?roleCode='+row.roleCode
					//url:'${pageContext.request.contextPath}/tree_data1.json'
				}); 
				selectRole = row.roleCode;
				$('#add_powr_win').dialog('open').dialog('setTitle','角色权限设置');  
            }else{
            	$.messager.alert('系统提示','<div style="margin-top:10px">请选择需要设置权限的角色记录!</div>','info');
            }
        }  
        
	</script>
</body>
